package part1.api.collection.collectiontest;



import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo {
    public static void main(String[] args) {
        //add()
        Collection c = new ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");

        //size()
        System.out.println("c初始长度："+c.size());

        //isEmpty()
        boolean empty = c.isEmpty();
        System.out.println(empty);

        //clear()
        c.clear();
        System.out.println("c清空长度"+c.size());

        //contains()
        Collection c1 = new ArrayList();
        c1.add(new Point(1,2));
        c1.add(new Point(3,4));
        c1.add(new Point(5,6));
        c1.add(new Point(1,2));
        Point p = new Point(1,2);
        boolean contain = c1.contains(p);
        System.out.println(contain);

        //remove()
        boolean move = c1.remove(p);
        System.out.println("c1:"+c1);

    }
}
